;(function(){
//一定需要在内存中
var ach_buff_cb = {
	//暂时使用内存存放，
	//目前写法都使用API式不可用闭包内存
	//TODO：做成非内存形式
	buffMap:{

	},
	_addBuffCallBack:function (eventName,ach_id,buff_id,cb) {
		console.log("add buffs", eventName, ach_id);
		var buffMap = ach_buff_cb.buffMap;
		eventName = eventName.toLowerCase();
		var ach_cb = buffMap[eventName]||(buffMap[eventName] = {});
		var buff_cb = ach_cb[ach_id]||(ach_cb[ach_id] = {});
		buff_cb[buff_id] = cb;
	},
	_emitBuffCallBack:function (eventName, ach_id) {
		console.log("emit buffs", eventName, ach_id);
		var buffMap = ach_buff_cb.buffMap;
		eventName = eventName.toLowerCase();
		var ach_cb = buffMap[eventName]||(buffMap[eventName] = {});
		var buff_cb = ach_cb[ach_id]||(ach_cb[ach_id] = {});
		Object.keys(buff_cb).forEach(function (buff_id){
			console.log("回调触发",buff_id);
			buff_cb[buff_id].call(BuffCon.get(buff_id),{
				// buff_id:buff_id,
				ach_id:ach_id,
				eventName:eventName
			});
		});
	}
};
module.exports = ach_buff_cb;

var BuffCon = require("../buff/_con");
}());